<template>
	<view class="content">
		<image class="footerMyImg" :src="imgUrl+'/conyerMy.png'" mode=""></image>
		<view style="position: relative;z-index: 1;">
			
			<view class="user flex-line-height borde-padd-24" style="padding-top: 50rpx;">
				<image class="_imgUrl" :src="imgUrl+'/home.png'" mode=""></image>
				<view class="flex-height-between" style="position: relative;z-index: 9;padding: 40rpx;width: 100%;">
					<view class="flex-line-height">
						<image v-if="!tokenC" class="user-img"  @click="goPages('/logon/logon/index')"  :src="imgUrl+'/footeHome.png'" mode=""></image>
						<view v-if="!tokenC" class="userButtom" @click="goPages('/logon/logon/index')">
							点击立即登录
						</view>
						<image class="user-img"  v-if="tokenC" :src="userInfoJson.avatar?'https://app.zizijy.com/'+userInfoJson.avatar:avatar" mode="" @click="goPages('/resume/onLine/index')"></image>
						<view class="user-info" v-if="tokenC" @click="goPages('/resume/onLine/index')">
							<view class="tiel" v-if="userInfoJson.full_name">{{userInfoJson.full_name}}
							<image v-if='userInfoJson.isvip' :src="imgUrl+'/VIP.png'" style="width: 96rpx; height: 40rpx;" mode=""></image>
							</view>
							<view class="tiel" v-else>{{userInfoJson.account}}</view>
							<view class="id">ID：{{userInfoJson.uid}}</view>
						</view>
						
					</view>
					<image style="width: 72rpx;height: 72rpx;" :src="imgUrl+'/heomeConyte.png'" mode="" @click="goPages('/resume/onLine/index')"></image>
				</view>
			</view>
			
			<!-- 
				data=>slisy=>
			 -->
			<view class="tab-jilu flex-height-between borde-padd-24">
				<view class="list left flex-line-height"  @click="goPages('/record/learningRecord/index?tabIndex=1')">
					<image class="img" :src="imgUrl+'/user1.png'" mode=""></image>
					<view class="list-left">
						<view class="tiel">考试记录</view>
						<view class="id">央国企笔试题库</view>
					</view>
				</view>
				<!-- record/learningRecord/index -->
				<!-- /record/learningRecord/index?tabIndex=2 -->
				<!-- pages/ai/cepingJIlu -->
				<!-- forInfo -->
				<!-- forInfo -->
				<!-- @click="goPages('/pages/ai/cepingJIlu')" -->
				<view class="list right flex-line-height"  @click="goPages('/pages/ai/ceList')">
					<image class="img" :src="imgUrl+'/ai-home.png'" mode=""></image>
					<view class="list-left">
						<view class="tiel">测评记录</view>
						<view class="id">Ai职业性格测试</view>
					</view>
				</view>
			</view>
		<!-- 	<view class="borde-padd-24">
				<view class="tab-anv-conter">
					<view class="tab-anv-list flex-height-between" >
						<view class="title">我的推广码</view>
						<view class="roghtCneys flex-height-between">
							<view style="color: #8F9294;">{{userInfoJson.referral_code}}</view>
							<view style="color: #3B5EEC;" @click="setClipboardData(userInfoJson.referral_code)">复制</view>
						</view>
					</view>
				</view>
			</view> -->
			<view class="borde-padd-24" v-if="in_conf.if_show && in_conf.if_show.ren">
				<view class="tab-anv-conter" >
					<view class="title-s">常用功能</view>
					<view class="flex-height-between">
						<view class="tab-anv-list" @click="goPages('/record/learningRecord/index')">
							<image class="img-se" :src="imgUrl+'/Commonfunctions-1.png'" mode=""></image>
							<view class="title">我的学习</view>
						</view>
						<view class="tab-anv-list" @click="goPages('/record/learningRecord/exam_index')">
							<image class="img-se" :src="imgUrl+'/Commonfunctions-2.png'" mode=""></image>
							<view class="title">我的考试</view>
						</view>
						<view class="tab-anv-list" @click="goPages('/record/learningRecord/colect_index')">
							<image class="img-se" :src="imgUrl+'/Commonfunctions-3.png'" mode=""></image>
							<view class="title">我的收藏</view>
						</view>
						<view class="tab-anv-list" @click="goPages('/record/learningRecord/index?tabIndex=1')">
							<image class="img-se" :src="imgUrl+'/Commonfunctions-4.png'" mode=""></image>
							<view class="title" >我的订单</view>
						</view>
					</view>
				</view>
			</view>
			<view class="borde-padd-24">
				<image @click="goPages('/record/adviser/index?id=22')" style="height: 148rpx;width: 100%;margin-top: 24rpx;" :src="imgUrl+'/fiidsaJIhua.png'" mode=""></image>
			</view>
			<view class="borde-padd-24">
				<view class="tab-anv-conter">
					<view class="title-s">其他功能</view>
					<view class="flex-wrap">
						<view class="tab-anv-list" @click="goPages('/record/adviser/index?id=31')">
							<image class="img-se" :src="imgUrl+'/qita-1.png'" mode=""></image>
							<view class="title">邀请有礼</view>
						</view>
						<view class="tab-anv-list" @click="goPages('/record/adviser/index?id=22')">
							<image class="img-se" :src="imgUrl+'/qita-4.png'" mode=""></image>
							<view class="title">联系老师</view>
						</view>
						<view class="tab-anv-list" >
							<image class="img-se" :src="imgUrl+'/qita-2.png'" @click="goPages('/logon/logon/xieyi')" mode=""></image>
							<view class="title">隐私政策</view>
						</view>
						<view class="tab-anv-list" @click="goPages('/logon/logon/zhengce')">
							<image class="img-se" :src="imgUrl+'/qita-3.png'" mode=""></image>
							<view class="title">服务协议</view>
						</view>
						
						<!-- <view class="tab-anv-list" >
							<image class="img-se" :src="imgUrl+'/qita-5.png'" mode=""></image>
							<view class="title">安全中心</view>
						</view>
						<view class="tab-anv-list" >
							<image class="img-se" :src="imgUrl+'/qita-6.png'" mode=""></image>
							<view class="title">设置</view>
						</view> -->
					</view>
				</view>
			</view>
		</view>
		<view class="tuichudengl" @click="tuichsuenSe">退出登录</view>
		<view @click="zhuxiao()" style="width: 100%; text-align: center; padding-top: 30rpx; color: #cccccc;">注销账号</view>
		<footerTer :active="3"></footerTer>
		
	</view>
</template>
<!-- uni.setStorageSync('token','') -->
<!-- 
	api/appraisal/getAppraisalResult 
-->
<script>
	import footerTer from "../../components/footer.vue"
	import {
		Request
	} from '@/utils/request.js'
	// /api/user/info
	export default {
		components:{
			footerTer
		},
	    data() {
	        return {
	            indicatorDots: false,
				userInfoJson:{},
				forInfo:{},
				in_conf:{},
				imgUrl:this.imgUrl,
				avatar:require('../../static/21723798284_.pic_hd.png'),
				tokenC:uni.getStorageSync('token')
	        }
	    },
		
		onLoad() {
			setTimeout(() => {
				this.userInfo();
				this.indexconf();
			}, 1000); // 延迟500ms 等待授权弹窗处理
			
			
			//this.appraisalgetAppraisalResult();
			//setUp/setUp/index
		},
	    methods: {
			indexconf(){
				Request('index_conf',{
				}).then((res) => {
					//console.log(res)
					this.in_conf=res;
					// this.jobConList = this.jobConList.concat(tdata);
				})
			},
			zhuxiao(){
				uni.showModal({
					title: '提示',
					content: '确认要注销账号吗？',
					success: function (res) {
						if (res.confirm) {
							Request('/user/zhuxiao').then((res)=>{
								
							});
							uni.setStorageSync('token','')
							this.goPages('/pages/index/index');
						} else if (res.cancel) {
							
						}
					}
				});
			},
			tuichsuenSe(){
				uni.setStorageSync('token','')
				this.goPages('/pages/index/index');
			},
			openContelITs(){
				// this.goPages('/pages/ai/ceList');
				this.goPages('/pages/ai/index');
				// if(this.forInfo.name){
				// }else if(!this.forInfo.name){
				// 	this.goPages('/pages/ai/index');
				// }
			},
			// appraisalgetAppraisalResult(){
			// 	Request('appraisal/getAppraisalResult',{
			// 		type:2
			// 	}).then((res)=>{
			// 		// console.log(res);
			// 		this.forInfo=res.data.data;
			// 	})
			// },
			setClipboardData(mes){
				uni.setClipboardData({
					data: mes,
					success: function () {
						uni.showToast({
							title: '复制成功',
							icon: 'none'
						  });
						console.log('success');
					}
				});
			},
			goPages(path){
				uni.navigateTo({
					url:path
				})
			},
			onmakePhoneCall(){
				uni.makePhoneCall({
					phoneNumber: '19153191198' //仅为示例
				});
			},
	       userInfo(){
			   Request('/user/info').then((res)=>{
				   this.userInfoJson=res;
			   })
		   }
	    }
	}
</script>

<style scoped>
	.scroll-view {
	  white-space: nowrap;
	  width: 100%;
	}
	.scroll-item .imgaerr{
		width: 234rpx;
		height: 132rpx;
	}
	.scroll-item .title{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 26rpx;
		color: #0E171F  !important;
		text-align: left !important;
		font-style: normal;
		text-transform: none;
	}
	.scroll-item .sub-title{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #98A3B9;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
	.tuichudengl{
		text-align: center;
		line-height: 80rpx;
		color: #fff;
		background: linear-gradient(90deg, #3B5EEC 0%, #60C7E0 100%);
		border-radius: 20rpx;
		width: 700rpx;
		font-size: 28rpx;
		margin: 0 auto;
		margin-top: 20rpx;
	}
	/* <!--
	.scroll-item 
	 imgaerr
	 title
	 sub-title
	 --> */
	.scroll-item {
	  display: inline-block;
	  width: 234rpx;
	  display: inline-block;
	  margin-right: 24rpx;
	  margin-right: 10px;
	  text-align: center;
	}
	.user{
		position: relative;
		z-index: 1;
		background: #FFFFFF;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
	}
	._imgUrl{
		width: 100%;
		height: 502rpx;
		position: relative;
	}
	.user ._imgUrl{
		width: 702rpx;
		height: 208rpx;
		position: absolute;
		left: 24rpx;
		top: 50rpx;
	}
	.user .user-img{
		width: 136rpx;
		height: 136rpx;
		border-radius: 50%;
		margin-right: 24rpx;
	}
	.user-info .tiel{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 36rpx;
		color: #0D0E0F;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
	.user-info .id{
		width: 202rpx;
		font-family: MiSans, MiSans;
		font-weight: 500;
		font-size: 28rpx;
		color: #98A3B9;
		line-height: 40rpx;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
	.user-kechen{
		flex: 1;
		padding-top: 40rpx;
		padding-bottom: 32rpx;
	}
	.user-kechen .num{
		font-family: MiSans, MiSans;
		font-weight: 600;
		font-size: 28rpx;
		color: #0D0E0F;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}
	.title-s{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #0E171F;
		text-align: left;
		font-style: normal;
		text-transform: none;
		margin-bottom: 32rpx;
	}
	.footerMyImg{
		position: absolute;
		z-index: 0;
		width: 100%;
	}
	.user-kechen .title{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #646669;
		text-align: center;
		font-style: normal;
		text-transform: none;
	}
	.tab-anv-conter .title{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: #6D7A96;
		text-align: center;
		width: 100%;
		font-style: normal;
		text-transform: none;
	}
	.tab-jilu{
		padding-top: 48rpx;
	}
	.roghtCneys{
		width: 450rpx;
	}
	.tab-jilu .list.left{
		width: 342rpx;
		height: 126rpx;
		background: linear-gradient( 90deg, #3B5EEC 0%, #60C7E0 100%);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	.tab-jilu .list.right{
		width: 342rpx;
		height: 126rpx;
		background: linear-gradient( 90deg, #0AD8B8 0%, #97E5A3 100%);
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	.tab-jilu .list{
		width: 342rpx;
		height: 126rpx;
		padding: 24rpx;
		box-sizing: border-box;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	.tab-jilu .list .img{
		width: 72rpx;
		height: 72rpx;
		margin-right: 24rpx;
	}
	.tab-jilu .list .tiel{
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #fff;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
	.tab-jilu .list .id{
		font-family: PingFang SC, PingFang SC;
		font-weight: 400;
		font-size: 24rpx;
		color: rgba(255,255,255,0.5);
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
	.tab-anv-conter{
		background: #FFFFFF;
		padding: 32rpx;
		box-sizing: border-box;
		margin-top: 24rpx;
		padding-bottom: 0;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
	.tab-anv-conter .tab-anv-list{
		display: flex;
		align-items: center;
		margin-bottom: 32rpx;
		justify-content: center;
		width: 25%;
		flex-wrap: wrap;
	}
	.tab-anv-conter .tab-anv-list .img-se{
		width: 88rpx;
		margin-bottom: 8rpx;
		height: 88rpx;
	}

	.userButtom{
		
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 40rpx;
		color: #0D0E0F;
		text-align: left;
		font-style: normal;
		text-transform: none;
	}
</style>